<?php
//by willson 105328468@qq.com 2014/10/11
//index page interface

class integral extends core {
	private $recharge_mod;
	public function __construct() {
		parent::__construct();
	}

	//明细
	public function history() {
		$offset = (isset($_GET['offset']) && trim($_GET['offset'])) ? intval($_GET['offset']) : 0;
		$pagesize = (isset($_GET['pagesize']) && trim($_GET['pagesize'])) ? intval($_GET['pagesize']) : 15;
		
		$sql = "SELECT * FROM jf_member_integral_history WHERE member_id='{$this->member_id}' 
			AND status='1' ORDER BY id DESC LIMIT {$offset},{$pagesize}";
		$histories = $this->db->get_results($sql);
		if ($histories) {
			foreach ($histories as $k => $h) {
				$histories[$k]->add_time = date("Y-m-d H:i:s", $h->add_time);
			}
		}
		success($histories);
	}

}
